package o;

import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;

public class evf {
    public static void ˋ(TextView textView, @ColorRes int i) {
        Context ˏ = ˏ(textView);
        if (ˏ == null) {
            return;
        }
        if (ˊ(textView)) {
            ((fle) ˏ).ˊ(textView, "textColor", i);
        } else {
            textView.setTextColor(ˏ.getResources().getColor(i));
        }
    }

    public static void ˎ(View view, @DrawableRes int i) {
        Context ˏ = ˏ(view);
        if (ˏ == null) {
            return;
        }
        if (ˊ(view)) {
            ((fle) ˏ).ˊ(view, "background", i);
        } else {
            view.setBackground(ˏ.getResources().getDrawable(i));
        }
    }

    public static void ॱ(View view, @ColorRes int i) {
        Context ˏ = ˏ(view);
        if (ˏ == null) {
            return;
        }
        if (ˊ(view)) {
            ((fle) ˏ).ˊ(view, "background", i);
        } else {
            view.setBackgroundColor(ˏ.getResources().getColor(i));
        }
    }

    public static void ˏ(ImageView imageView, @DrawableRes int i) {
        Context ˏ = ˏ(imageView);
        if (ˏ == null) {
            return;
        }
        if (ˊ(imageView)) {
            ((fle) ˏ).ˊ(imageView, "src", i);
        } else {
            imageView.setImageResource(i);
        }
    }

    public static int ॱ(Context context, @ColorRes int i) {
        if ((context instanceof etv) && ((etv) context).ॱʼ()) {
            Object ˏ = fmw.ˏ(context, i, "color");
            if (ˏ instanceof Integer) {
                return ((Integer) ˏ).intValue();
            }
        }
        return context.getResources().getColor(i);
    }

    public static Drawable ˋ(Context context, @DrawableRes int i) {
        if ((context instanceof etv) && ((etv) context).ॱʼ()) {
            Object ˏ = fmw.ˏ(context, i, "drawable");
            if (ˏ instanceof Drawable) {
                return (Drawable) ˏ;
            }
        }
        return context.getResources().getDrawable(i);
    }

    private static Context ˏ(View view) {
        return view == null ? null : view.getContext();
    }

    public static boolean ˊ(View view) {
        Context ˏ = ˏ(view);
        if ((ˏ instanceof etv) && ((etv) ˏ).ॱʼ()) {
            return true;
        }
        return false;
    }

    public static boolean ˋ(Context context) {
        if ((context instanceof etv) && ((etv) context).ॱʼ()) {
            return true;
        }
        return false;
    }

    public static boolean ˋ(Activity activity) {
        if ((activity instanceof etv) && ((etv) activity).ॱʼ()) {
            return true;
        }
        return false;
    }

    public static void ˎ(View view, SkinAttr o_fko) {
        if (!ˊ(view)) {
            return;
        }
        if (flr.ˋ(view.getContext()).ˋ()) {
            o_fko.ˎ(view, true);
            return;
        }
        SkinnableView o_fkw = new SkinnableView();
        o_fkw.ˋ(view);
        o_fkw.ˏ().add(o_fko);
        ((etv) view.getContext()).ˋ(o_fkw);
    }
}
